<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE DeriveGeneric #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE StandaloneDeriving #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-inline-rule-shadowing #-}</span><span>
</span><span id="line-7"></span><span>    </span><span class="hs-comment">-- The RULES for the methods of class Arrow may never fire</span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-comment">-- e.g. compose/arr;  see #10528</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Module      :  Control.Arrow</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Copyright   :  (c) Ross Paterson 2002</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- License     :  BSD-style (see the LICENSE file in the distribution)</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- Basic arrow definitions, based on</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">--  * /Generalising Monads to Arrows/, by John Hughes,</span><span>
</span><span id="line-23"></span><span class="hs-comment">--    /Science of Computer Programming/ 37, pp67-111, May 2000.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- plus a couple of definitions ('returnA' and 'loop') from</span><span>
</span><span id="line-26"></span><span class="hs-comment">--</span><span>
</span><span id="line-27"></span><span class="hs-comment">--  * /A New Notation for Arrows/, by Ross Paterson, in /ICFP 2001/,</span><span>
</span><span id="line-28"></span><span class="hs-comment">--    Firenze, Italy, pp229-240.</span><span>
</span><span id="line-29"></span><span class="hs-comment">--</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- These papers and more information on arrows can be found at</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- &lt;http://www.haskell.org/arrows/&gt;.</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Arrow</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Arrows</span></span><span>
</span><span id="line-35"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier">Arrow</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier">Kleisli</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Derived combinators</span></span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#returnA"><span class="hs-identifier">returnA</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#%5E%3E%3E"><span class="hs-operator">(^&gt;&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#%3E%3E%5E"><span class="hs-operator">(&gt;&gt;^)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>    </span><span class="annot"><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator">(&gt;&gt;&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Category.html#%3C%3C%3C"><span class="hs-operator">(&lt;&lt;&lt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- reexported</span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Right-to-left variants</span></span><span>
</span><span id="line-41"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#%3C%3C%5E"><span class="hs-operator">(&lt;&lt;^)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#%5E%3C%3C"><span class="hs-operator">(^&lt;&lt;)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Monoid operations</span></span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#ArrowZero"><span class="hs-identifier">ArrowZero</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowPlus"><span class="hs-identifier">ArrowPlus</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Conditionals</span></span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#ArrowChoice"><span class="hs-identifier">ArrowChoice</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Arrow application</span></span><span>
</span><span id="line-47"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier">ArrowApply</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier">ArrowMonad</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#leftApp"><span class="hs-identifier">leftApp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Feedback</span></span><span>
</span><span id="line-49"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#ArrowLoop"><span class="hs-identifier">ArrowLoop</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Tuple.html"><span class="hs-identifier">Data.Tuple</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Data.Tuple.html#fst"><span class="hs-identifier">fst</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Tuple.html#snd"><span class="hs-identifier">snd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Tuple.html#uncurry"><span class="hs-identifier">uncurry</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Either.html"><span class="hs-identifier">Data.Either</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Fix.html"><span class="hs-identifier">Control.Monad.Fix</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Category.html"><span class="hs-identifier">Control.Category</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Base.html#."><span class="hs-operator">(.)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#id"><span class="hs-identifier">id</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Generics.html"><span class="hs-identifier">GHC.Generics</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Generics.html#Generic"><span class="hs-identifier">Generic</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Generics.html#Generic1"><span class="hs-identifier">Generic1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Control.Arrow.html#%3C%2B%3E"><span class="hs-operator hs-type">&lt;+&gt;</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">3</span><span> </span><span class="annot"><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-operator hs-type">***</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">3</span><span> </span><span class="annot"><a href="Control.Arrow.html#%26%26%26"><span class="hs-operator hs-type">&amp;&amp;&amp;</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">2</span><span> </span><span class="annot"><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-type">+++</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">2</span><span> </span><span class="annot"><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-type">|||</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">1</span><span> </span><span class="annot"><a href="Control.Arrow.html#%5E%3E%3E"><span class="hs-operator hs-type">^&gt;&gt;</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#%3E%3E%5E"><span class="hs-operator hs-type">&gt;&gt;^</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">1</span><span> </span><span class="annot"><a href="Control.Arrow.html#%5E%3C%3C"><span class="hs-operator hs-type">^&lt;&lt;</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#%3C%3C%5E"><span class="hs-operator hs-type">&lt;&lt;^</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-comment">-- | The basic arrow class.</span><span>
</span><span id="line-68"></span><span class="hs-comment">--</span><span>
</span><span id="line-69"></span><span class="hs-comment">-- Instances should satisfy the following laws:</span><span>
</span><span id="line-70"></span><span class="hs-comment">--</span><span>
</span><span id="line-71"></span><span class="hs-comment">--  * @'arr' id = 'id'@</span><span>
</span><span id="line-72"></span><span class="hs-comment">--</span><span>
</span><span id="line-73"></span><span class="hs-comment">--  * @'arr' (f &gt;&gt;&gt; g) = 'arr' f &gt;&gt;&gt; 'arr' g@</span><span>
</span><span id="line-74"></span><span class="hs-comment">--</span><span>
</span><span id="line-75"></span><span class="hs-comment">--  * @'first' ('arr' f) = 'arr' ('first' f)@</span><span>
</span><span id="line-76"></span><span class="hs-comment">--</span><span>
</span><span id="line-77"></span><span class="hs-comment">--  * @'first' (f &gt;&gt;&gt; g) = 'first' f &gt;&gt;&gt; 'first' g@</span><span>
</span><span id="line-78"></span><span class="hs-comment">--</span><span>
</span><span id="line-79"></span><span class="hs-comment">--  * @'first' f &gt;&gt;&gt; 'arr' 'fst' = 'arr' 'fst' &gt;&gt;&gt; f@</span><span>
</span><span id="line-80"></span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span class="hs-comment">--  * @'first' f &gt;&gt;&gt; 'arr' ('id' *** g) = 'arr' ('id' *** g) &gt;&gt;&gt; 'first' f@</span><span>
</span><span id="line-82"></span><span class="hs-comment">--</span><span>
</span><span id="line-83"></span><span class="hs-comment">--  * @'first' ('first' f) &gt;&gt;&gt; 'arr' assoc = 'arr' assoc &gt;&gt;&gt; 'first' f@</span><span>
</span><span id="line-84"></span><span class="hs-comment">--</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- where</span><span>
</span><span id="line-86"></span><span class="hs-comment">--</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- &gt; assoc ((a,b),c) = (a,(b,c))</span><span>
</span><span id="line-88"></span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- The other combinators have sensible default definitions,</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- which may be overridden for efficiency.</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Category.html#Category"><span class="hs-identifier hs-type">Category</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Arrow"><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-var">Arrow</span></a></span></span><span> </span><span id="local-6989586621679561962"><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-pragma">{-# MINIMAL</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span class="hs-pragma">,</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="hs-pragma">|</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">***</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-comment">-- | Lift a function to an arrow.</span><span>
</span><span id="line-96"></span><span>    </span><span id="local-6989586621679561932"><span id="local-6989586621679561933"><span id="arr"><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-type">arr</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561933"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561932"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561933"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561932"><span class="hs-identifier hs-type">c</span></a></span></span></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-comment">-- | Send the first component of the input through the argument</span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-comment">--   arrow, and copy the rest unchanged to the output.</span><span>
</span><span id="line-100"></span><span>    </span><span id="local-6989586621679561959"><span id="local-6989586621679561960"><span id="local-6989586621679561961"><span id="first"><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-identifier hs-type">first</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561961"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561960"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561961"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561959"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561960"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561959"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621679561565"><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-identifier hs-var hs-var">first</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a b c -&gt; a d d -&gt; a (b, d) (c, d)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
Arrow a =&gt;
a b c -&gt; a b' c' -&gt; a (b, b') (c, c')
</span><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-operator hs-var">***</span></a></span><span> </span><span class="annot"><span class="annottext">a d d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-comment">-- | A mirror image of 'first'.</span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-comment">--   The default definition may be overridden with a more efficient</span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-comment">--   version if desired.</span><span>
</span><span id="line-107"></span><span>    </span><span id="local-6989586621679561946"><span id="local-6989586621679561947"><span id="local-6989586621679561948"><span id="second"><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-identifier hs-type">second</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561948"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561947"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561946"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561948"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561946"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561947"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621679561559"><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-identifier hs-var hs-var">second</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a d d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">a d d -&gt; a b c -&gt; a (d, b) (d, c)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
Arrow a =&gt;
a b c -&gt; a b' c' -&gt; a (b, b') (c, c')
</span><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-operator hs-var">***</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span>    </span><span class="hs-comment">-- | Split the input between the two argument arrows and combine</span><span>
</span><span id="line-111"></span><span>    </span><span class="hs-comment">--   their output.  Note that this is in general not a functor.</span><span>
</span><span id="line-112"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-comment">--   The default definition may be overridden with a more efficient</span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-comment">--   version if desired.</span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621679561952"><span id="local-6989586621679561953"><span id="local-6989586621679561954"><span id="local-6989586621679561955"><span id="%2A%2A%2A"><span class="annot"><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-operator hs-type">(***)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561955"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561954"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561953"><span class="hs-identifier hs-type">b'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561952"><span class="hs-identifier hs-type">c'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561955"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561953"><span class="hs-identifier hs-type">b'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561954"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561952"><span class="hs-identifier hs-type">c'</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-116"></span><span>    </span><span id="local-6989586621679561555"><span id="local-6989586621679561546"><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561546"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-operator hs-var hs-var">***</span></a></span><span> </span><span id="local-6989586621679561545"><span class="annot"><span class="annottext">a b' c'
</span><a href="#local-6989586621679561545"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a b c -&gt; a (b, b') (c, b')
forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
a b c -&gt; a (b, d) (c, d)
</span><a href="Control.Arrow.html#first"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561546"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a (b, b') (c, b') -&gt; a (c, b') (c, c') -&gt; a (b, b') (c, c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">((c, b') -&gt; (b', c)) -&gt; a (c, b') (b', c)
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">(c, b') -&gt; (b', c)
forall {b} {a}. (b, a) -&gt; (a, b)
</span><a href="#local-6989586621679561544"><span class="hs-identifier hs-var">swap</span></a></span><span> </span><span class="annot"><span class="annottext">a (c, b') (b', c) -&gt; a (b', c) (c, c') -&gt; a (c, b') (c, c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a b' c' -&gt; a (b', c) (c', c)
forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
a b c -&gt; a (b, d) (c, d)
</span><a href="Control.Arrow.html#first"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="annot"><span class="annottext">a b' c'
</span><a href="#local-6989586621679561545"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a (b', c) (c', c) -&gt; a (c', c) (c, c') -&gt; a (b', c) (c, c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">((c', c) -&gt; (c, c')) -&gt; a (c', c) (c, c')
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">(c', c) -&gt; (c, c')
forall {b} {a}. (b, a) -&gt; (a, b)
</span><a href="#local-6989586621679561544"><span class="hs-identifier hs-var">swap</span></a></span><span>
</span><span id="line-117"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679561544"><span class="annot"><span class="annottext">swap :: (b, a) -&gt; (a, b)
</span><a href="#local-6989586621679561544"><span class="hs-identifier hs-var hs-var">swap</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679561543"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561543"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679561542"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561542"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561542"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561543"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-comment">-- | Fanout: send the input to both argument arrows and combine</span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-comment">--   their output.</span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-comment">--   The default definition may be overridden with a more efficient</span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-comment">--   version if desired.</span><span>
</span><span id="line-124"></span><span>    </span><span id="local-6989586621679561927"><span id="local-6989586621679561928"><span id="local-6989586621679561929"><span id="%26%26%26"><span class="annot"><a href="Control.Arrow.html#%26%26%26"><span class="hs-operator hs-type">(&amp;&amp;&amp;)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561929"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561928"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561929"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561927"><span class="hs-identifier hs-type">c'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561962"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561929"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561928"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561927"><span class="hs-identifier hs-type">c'</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-125"></span><span>    </span><span id="local-6989586621679561541"><span id="local-6989586621679561536"><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561536"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#%26%26%26"><span class="hs-operator hs-var hs-var">&amp;&amp;&amp;</span></a></span><span> </span><span id="local-6989586621679561535"><span class="annot"><span class="annottext">a b c'
</span><a href="#local-6989586621679561535"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; (b, b)) -&gt; a b (b, b)
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679561534"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561534"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561534"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561534"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a b (b, b) -&gt; a (b, b) (c, c') -&gt; a b (c, c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561536"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a b c -&gt; a b c' -&gt; a (b, b) (c, c')
forall (a :: * -&gt; * -&gt; *) b c b' c'.
Arrow a =&gt;
a b c -&gt; a b' c' -&gt; a (b, b') (c, c')
</span><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-operator hs-var">***</span></a></span><span> </span><span class="annot"><span class="annottext">a b c'
</span><a href="#local-6989586621679561535"><span class="hs-identifier hs-var">g</span></a></span></span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-128"></span><span class="annot"><span class="hs-pragma">&quot;compose/arr&quot;</span></span><span>   </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561533"><span class="annot"><a href="#local-6989586621679561533"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561532"><span class="annot"><a href="#local-6989586621679561532"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-129"></span><span>                </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561533"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561532"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561533"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561532"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-130"></span><span class="annot"><span class="hs-pragma">&quot;first/arr&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561530"><span class="annot"><a href="#local-6989586621679561530"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-131"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561530"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561530"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-132"></span><span class="annot"><span class="hs-pragma">&quot;second/arr&quot;</span></span><span>    </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561529"><span class="annot"><a href="#local-6989586621679561529"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-133"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-pragma hs-type">second</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561529"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-pragma hs-type">second</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561529"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-134"></span><span class="annot"><span class="hs-pragma">&quot;product/arr&quot;</span></span><span>   </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561528"><span class="annot"><a href="#local-6989586621679561528"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561527"><span class="annot"><a href="#local-6989586621679561527"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-135"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561528"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-pragma hs-type">***</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561527"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561528"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%2A%2A%2A"><span class="hs-pragma hs-type">***</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561527"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-136"></span><span class="annot"><span class="hs-pragma">&quot;fanout/arr&quot;</span></span><span>    </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561526"><span class="annot"><a href="#local-6989586621679561526"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561525"><span class="annot"><a href="#local-6989586621679561525"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-137"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561526"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%26%26%26"><span class="hs-pragma hs-type">&amp;&amp;&amp;</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561525"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561526"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%26%26%26"><span class="hs-pragma hs-type">&amp;&amp;&amp;</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561525"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-138"></span><span class="annot"><span class="hs-pragma">&quot;compose/first&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561524"><span class="annot"><a href="#local-6989586621679561524"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561523"><span class="annot"><a href="#local-6989586621679561523"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-139"></span><span>                </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561524"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561523"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561524"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561523"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-140"></span><span class="annot"><span class="hs-pragma">&quot;compose/second&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561522"><span class="annot"><a href="#local-6989586621679561522"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561521"><span class="annot"><a href="#local-6989586621679561521"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-141"></span><span>                </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-pragma hs-type">second</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561522"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-pragma hs-type">second</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561521"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#second"><span class="hs-pragma hs-type">second</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561522"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561521"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-142"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-comment">-- Ordinary functions are arrows.</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-147"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561510"><span id="local-6989586621679561513"><span id="local-6989586621679561515"><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-148"></span><span>    </span><span id="local-6989586621679561508"><span class="annot"><span class="annottext">arr :: forall b c. (b -&gt; c) -&gt; b -&gt; c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var hs-var hs-var hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679561507"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561507"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561507"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-149"></span><span class="hs-comment">--  (f *** g) ~(x,y) = (f x, g y)</span><span>
</span><span id="line-150"></span><span class="hs-comment">--  sorry, although the above defn is fully H'98, nhc98 can't parse it.</span><span>
</span><span id="line-151"></span><span>    </span><span id="local-6989586621679561506"><span class="annot"><span class="annottext">*** :: forall b c b' c'. (b -&gt; c) -&gt; (b' -&gt; c') -&gt; (b, b') -&gt; (c, c')
</span><a href="#local-6989586621679561506"><span class="hs-operator hs-var hs-var hs-var hs-var">(***)</span></a></span></span><span> </span><span id="local-6989586621679561505"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561505"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561504"><span class="annot"><span class="annottext">b' -&gt; c'
</span><a href="#local-6989586621679561504"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679561503"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561503"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679561502"><span class="annot"><span class="annottext">b'
</span><a href="#local-6989586621679561502"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561505"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561503"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b' -&gt; c'
</span><a href="#local-6989586621679561504"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">b'
</span><a href="#local-6989586621679561502"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">-- | Kleisli arrows of a monad.</span><span>
</span><span id="line-154"></span><span id="local-6989586621679561495"><span id="local-6989586621679561496"><span id="local-6989586621679561498"><span id="local-6989586621679561501"></span></span></span></span><span class="hs-keyword">newtype</span><span> </span><span id="Kleisli"><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span></span><span> </span><span id="local-6989586621679561907"><span class="annot"><a href="#local-6989586621679561907"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679561906"><span class="annot"><a href="#local-6989586621679561906"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679561905"><span class="annot"><a href="#local-6989586621679561905"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Kleisli"><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="runKleisli"><span class="annot"><span class="annottext">forall (m :: * -&gt; *) a b. Kleisli m a b -&gt; a -&gt; m b
</span><a href="Control.Arrow.html#runKleisli"><span class="hs-identifier hs-var hs-var">runKleisli</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561906"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561907"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561905"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-157"></span><span id="local-6989586621679561898"><span id="local-6989586621679561899"><span id="local-6989586621679561900"><span class="hs-keyword">deriving</span><span> </span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Generics.html#Generic"><span class="hs-identifier hs-type">Generic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561900"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561899"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561898"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-160"></span><span id="local-6989586621679561894"><span id="local-6989586621679561895"><span class="hs-keyword">deriving</span><span> </span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Generics.html#Generic1"><span class="hs-identifier hs-type">Generic1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561895"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561894"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-163"></span><span id="local-6989586621679561479"><span id="local-6989586621679561482"><span id="local-6989586621679561885"><span id="local-6989586621679561886"><span class="hs-keyword">deriving</span><span> </span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561886"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561886"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561885"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-166"></span><span id="local-6989586621679561872"><span id="local-6989586621679561873"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561470"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561873"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561873"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561872"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-167"></span><span>  </span><span id="local-6989586621679561463"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Kleisli m a a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m a) -&gt; Kleisli m a a)
-&gt; (a -&gt; a -&gt; m a) -&gt; a -&gt; Kleisli m a a
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; a -&gt; m a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; a -&gt; m a) -&gt; (a -&gt; m a) -&gt; a -&gt; a -&gt; m a
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-169"></span><span>  </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561460"><span class="annot"><span class="annottext">a -&gt; m (a -&gt; b)
</span><a href="#local-6989586621679561460"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561459"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Kleisli m a (a -&gt; b) -&gt; Kleisli m a a -&gt; Kleisli m a b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561458"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561458"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m b) -&gt; Kleisli m a b
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m b) -&gt; Kleisli m a b) -&gt; (a -&gt; m b) -&gt; Kleisli m a b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561457"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561457"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m (a -&gt; b)
</span><a href="#local-6989586621679561460"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561457"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m (a -&gt; b) -&gt; m a -&gt; m b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561458"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561457"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-170"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-171"></span><span>  </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561455"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561455"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561454"><span class="annot"><span class="annottext">*&gt; :: forall a b. Kleisli m a a -&gt; Kleisli m a b -&gt; Kleisli m a b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">*&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561453"><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679561453"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m b) -&gt; Kleisli m a b
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m b) -&gt; Kleisli m a b) -&gt; (a -&gt; m b) -&gt; Kleisli m a b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561452"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561452"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561455"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561452"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m b -&gt; m b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f b -&gt; f b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var">*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679561453"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561452"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-172"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-173"></span><span>  </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561450"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561450"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561449"><span class="annot"><span class="annottext">&lt;* :: forall a b. Kleisli m a a -&gt; Kleisli m a b -&gt; Kleisli m a a
</span><a href="GHC.Base.html#%3C%2A"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561447"><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679561447"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m a) -&gt; Kleisli m a a) -&gt; (a -&gt; m a) -&gt; Kleisli m a a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561446"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561446"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561450"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561446"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m b -&gt; m a
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f b -&gt; f a
</span><a href="GHC.Base.html#%3C%2A"><span class="hs-operator hs-var">&lt;*</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679561447"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561446"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-174"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-177"></span><span id="local-6989586621679561851"><span id="local-6989586621679561852"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561438"><span id="local-6989586621679561440"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561852"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561852"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561851"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-178"></span><span>  </span><span id="local-6989586621679561435"><span class="annot"><span class="annottext">empty :: forall a. Kleisli m a a
</span><a href="GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m a) -&gt; Kleisli m a a) -&gt; (a -&gt; m a) -&gt; Kleisli m a a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; a -&gt; m a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a
</span><a href="GHC.Base.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-179"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#empty"><span class="hs-pragma hs-type">empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-180"></span><span>  </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561432"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561432"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561431"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. Kleisli m a a -&gt; Kleisli m a a -&gt; Kleisli m a a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561429"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561429"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m a) -&gt; Kleisli m a a) -&gt; (a -&gt; m a) -&gt; Kleisli m a a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561428"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561428"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561432"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561428"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a -&gt; m a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561429"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561428"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-181"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;|&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-184"></span><span id="local-6989586621679561841"><span id="local-6989586621679561842"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561421"><span id="local-6989586621679561423"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561842"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561842"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561841"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-185"></span><span>  </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561418"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561418"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561417"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. Kleisli m a a -&gt; (a -&gt; Kleisli m a b) -&gt; Kleisli m a b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679561416"><span class="annot"><span class="annottext">a -&gt; Kleisli m a b
</span><a href="#local-6989586621679561416"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m b) -&gt; Kleisli m a b
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m b) -&gt; Kleisli m a b) -&gt; (a -&gt; m b) -&gt; Kleisli m a b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561415"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561415"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561418"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561415"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561414"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561414"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Kleisli m a b -&gt; a -&gt; m b
forall (m :: * -&gt; *) a b. Kleisli m a b -&gt; a -&gt; m b
</span><a href="Control.Arrow.html#runKleisli"><span class="hs-identifier hs-var hs-var">runKleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Kleisli m a b
</span><a href="#local-6989586621679561416"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561414"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561415"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-186"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;=</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-189"></span><span id="local-6989586621679561832"><span id="local-6989586621679561833"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561833"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561833"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561832"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-190"></span><span>  </span><span id="local-6989586621679561399"><span class="annot"><span class="annottext">mzero :: forall a. Kleisli m a a
</span><a href="GHC.Base.html#mzero"><span class="hs-identifier hs-var hs-var hs-var hs-var">mzero</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m a) -&gt; Kleisli m a a) -&gt; (a -&gt; m a) -&gt; Kleisli m a a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; a -&gt; m a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-191"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mzero"><span class="hs-pragma hs-type">mzero</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-192"></span><span>  </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561396"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561396"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561395"><span class="annot"><span class="annottext">mplus :: forall a. Kleisli m a a -&gt; Kleisli m a a -&gt; Kleisli m a a
</span><a href="GHC.Base.html#mplus"><span class="hs-operator hs-var hs-var hs-var hs-var">`mplus`</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561393"><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561393"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; m a) -&gt; Kleisli m a a) -&gt; (a -&gt; m a) -&gt; Kleisli m a a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561392"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561392"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561396"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561392"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="GHC.Base.html#mplus"><span class="hs-operator hs-var">`mplus`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
</span><a href="#local-6989586621679561393"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561392"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-193"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mplus"><span class="hs-pragma hs-type">mplus</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="hs-comment">-- | @since 3.0</span><span>
</span><span id="line-196"></span><span id="local-6989586621679561828"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561828"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Category.html#Category"><span class="hs-identifier hs-type">Category</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561828"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-197"></span><span>    </span><span id="local-6989586621679561385"><span class="annot"><span class="annottext">id :: forall a. Kleisli m a a
</span><a href="#local-6989586621679561385"><span class="hs-identifier hs-var hs-var hs-var hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; Kleisli m a a
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561383"><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561383"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679561382"><span class="annot"><span class="annottext">. :: forall b c a. Kleisli m b c -&gt; Kleisli m a b -&gt; Kleisli m a c
</span><a href="#local-6989586621679561382"><span class="hs-operator hs-var hs-var hs-var hs-var">.</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561381"><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679561381"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m c) -&gt; Kleisli m a c
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679561380"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561380"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679561381"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561380"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">m b -&gt; (b -&gt; m c) -&gt; m c
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561383"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-201"></span><span id="local-6989586621679561823"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561371"><span id="local-6989586621679561373"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561823"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561823"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-202"></span><span>    </span><span id="local-6989586621679561368"><span class="annot"><span class="annottext">arr :: forall b c. (b -&gt; c) -&gt; Kleisli m b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var hs-var hs-var hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679561367"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561367"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; m c) -&gt; Kleisli m b c
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c -&gt; m c
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(c -&gt; m c) -&gt; (b -&gt; c) -&gt; b -&gt; m c
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561367"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span>    </span><span id="local-6989586621679561364"><span class="annot"><span class="annottext">first :: forall b c d. Kleisli m b c -&gt; Kleisli m (b, d) (c, d)
</span><a href="Control.Arrow.html#first"><span class="hs-identifier hs-var hs-var hs-var hs-var">first</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561363"><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561363"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((b, d) -&gt; m (c, d)) -&gt; Kleisli m (b, d) (c, d)
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679561362"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561362"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679561361"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561361"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561363"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561362"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">m c -&gt; (c -&gt; m (c, d)) -&gt; m (c, d)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561360"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679561360"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(c, d) -&gt; m (c, d)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679561360"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561361"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-204"></span><span>    </span><span id="local-6989586621679561357"><span class="annot"><span class="annottext">second :: forall b c d. Kleisli m b c -&gt; Kleisli m (d, b) (d, c)
</span><a href="#local-6989586621679561357"><span class="hs-identifier hs-var hs-var hs-var hs-var">second</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561356"><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561356"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((d, b) -&gt; m (d, c)) -&gt; Kleisli m (d, b) (d, c)
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679561355"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561355"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679561354"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561354"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561356"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561354"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">m c -&gt; (c -&gt; m (d, c)) -&gt; m (d, c)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679561353"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679561353"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(d, c) -&gt; m (d, c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561355"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679561353"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span class="hs-comment">-- | The identity arrow, which plays the role of 'return' in arrow notation.</span><span>
</span><span id="line-207"></span><span id="local-6989586621679561813"><span id="local-6989586621679561814"><span class="annot"><a href="Control.Arrow.html#returnA"><span class="hs-identifier hs-type">returnA</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561814"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561814"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561813"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561813"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-208"></span><span id="returnA"><span class="annot"><span class="annottext">returnA :: forall (a :: * -&gt; * -&gt; *) b. Arrow a =&gt; a b b
</span><a href="Control.Arrow.html#returnA"><span class="hs-identifier hs-var hs-var">returnA</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; b) -&gt; a b b
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- | Precomposition with a pure function.</span><span>
</span><span id="line-211"></span><span id="local-6989586621679561807"><span id="local-6989586621679561808"><span id="local-6989586621679561809"><span id="local-6989586621679561810"><span class="annot"><a href="Control.Arrow.html#%5E%3E%3E"><span class="hs-operator hs-type">(^&gt;&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561810"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561809"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561808"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561810"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561808"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561807"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561810"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561809"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561807"><span class="hs-identifier hs-type">d</span></a></span></span></span></span></span><span>
</span><span id="line-212"></span><span id="local-6989586621679561345"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561345"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="%5E%3E%3E"><span class="annot"><span class="annottext">^&gt;&gt; :: forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
(b -&gt; c) -&gt; a c d -&gt; a b d
</span><a href="Control.Arrow.html#%5E%3E%3E"><span class="hs-operator hs-var hs-var">^&gt;&gt;</span></a></span></span><span> </span><span id="local-6989586621679561344"><span class="annot"><span class="annottext">a c d
</span><a href="#local-6989586621679561344"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; c) -&gt; a b c
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561345"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a b c -&gt; a c d -&gt; a b d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a c d
</span><a href="#local-6989586621679561344"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-comment">-- | Postcomposition with a pure function.</span><span>
</span><span id="line-215"></span><span id="local-6989586621679561799"><span id="local-6989586621679561800"><span id="local-6989586621679561801"><span id="local-6989586621679561802"><span class="annot"><a href="Control.Arrow.html#%3E%3E%5E"><span class="hs-operator hs-type">(&gt;&gt;^)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561802"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561802"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561801"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561800"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561800"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561799"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561802"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561801"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561799"><span class="hs-identifier hs-type">d</span></a></span></span></span></span></span><span>
</span><span id="line-216"></span><span id="local-6989586621679561339"><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561339"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="%3E%3E%5E"><span class="annot"><span class="annottext">&gt;&gt;^ :: forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
a b c -&gt; (c -&gt; d) -&gt; a b d
</span><a href="Control.Arrow.html#%3E%3E%5E"><span class="hs-operator hs-var hs-var">&gt;&gt;^</span></a></span></span><span> </span><span id="local-6989586621679561338"><span class="annot"><span class="annottext">c -&gt; d
</span><a href="#local-6989586621679561338"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561339"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a b c -&gt; a c d -&gt; a b d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(c -&gt; d) -&gt; a c d
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; d
</span><a href="#local-6989586621679561338"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="hs-comment">-- | Precomposition with a pure function (right-to-left variant).</span><span>
</span><span id="line-219"></span><span id="local-6989586621679561791"><span id="local-6989586621679561792"><span id="local-6989586621679561793"><span id="local-6989586621679561794"><span class="annot"><a href="Control.Arrow.html#%3C%3C%5E"><span class="hs-operator hs-type">(&lt;&lt;^)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561794"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561794"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561793"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561792"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561791"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561793"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561794"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561791"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561792"><span class="hs-identifier hs-type">d</span></a></span></span></span></span></span><span>
</span><span id="line-220"></span><span id="local-6989586621679561333"><span class="annot"><span class="annottext">a c d
</span><a href="#local-6989586621679561333"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="%3C%3C%5E"><span class="annot"><span class="annottext">&lt;&lt;^ :: forall (a :: * -&gt; * -&gt; *) c d b.
Arrow a =&gt;
a c d -&gt; (b -&gt; c) -&gt; a b d
</span><a href="Control.Arrow.html#%3C%3C%5E"><span class="hs-operator hs-var hs-var">&lt;&lt;^</span></a></span></span><span> </span><span id="local-6989586621679561332"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561332"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a c d
</span><a href="#local-6989586621679561333"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a c d -&gt; a b c -&gt; a b d
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#%3C%3C%3C"><span class="hs-operator hs-var">&lt;&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; c) -&gt; a b c
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561332"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-comment">-- | Postcomposition with a pure function (right-to-left variant).</span><span>
</span><span id="line-223"></span><span id="local-6989586621679561778"><span id="local-6989586621679561779"><span id="local-6989586621679561780"><span id="local-6989586621679561781"><span class="annot"><a href="Control.Arrow.html#%5E%3C%3C"><span class="hs-operator hs-type">(^&lt;&lt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561781"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561780"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561779"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561781"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561778"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561780"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561781"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561778"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561779"><span class="hs-identifier hs-type">d</span></a></span></span></span></span></span><span>
</span><span id="line-224"></span><span id="local-6989586621679561327"><span class="annot"><span class="annottext">c -&gt; d
</span><a href="#local-6989586621679561327"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="%5E%3C%3C"><span class="annot"><span class="annottext">^&lt;&lt; :: forall (a :: * -&gt; * -&gt; *) c d b.
Arrow a =&gt;
(c -&gt; d) -&gt; a b c -&gt; a b d
</span><a href="Control.Arrow.html#%5E%3C%3C"><span class="hs-operator hs-var hs-var">^&lt;&lt;</span></a></span></span><span> </span><span id="local-6989586621679561326"><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561326"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(c -&gt; d) -&gt; a c d
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; d
</span><a href="#local-6989586621679561327"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a c d -&gt; a b c -&gt; a b d
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#%3C%3C%3C"><span class="hs-operator hs-var">&lt;&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561326"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561773"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="ArrowZero"><span class="annot"><a href="Control.Arrow.html#ArrowZero"><span class="hs-identifier hs-var">ArrowZero</span></a></span></span><span> </span><span id="local-6989586621679561773"><span class="annot"><a href="#local-6989586621679561773"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-227"></span><span>    </span><span id="local-6989586621679561770"><span id="local-6989586621679561771"><span id="zeroArrow"><span class="annot"><a href="Control.Arrow.html#zeroArrow"><span class="hs-identifier hs-type">zeroArrow</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561773"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561771"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561770"><span class="hs-identifier hs-type">c</span></a></span></span></span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-230"></span><span id="local-6989586621679561769"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561769"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowZero"><span class="hs-identifier hs-type">ArrowZero</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561769"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-231"></span><span>    </span><span id="local-6989586621679561316"><span class="annot"><span class="annottext">zeroArrow :: forall b c. Kleisli m b c
</span><a href="#local-6989586621679561316"><span class="hs-identifier hs-var hs-var hs-var hs-var">zeroArrow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; m c) -&gt; Kleisli m b c
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m c
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span class="hs-comment">-- | A monoid on arrows.</span><span>
</span><span id="line-234"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowZero"><span class="hs-identifier hs-type">ArrowZero</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561766"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="ArrowPlus"><span class="annot"><a href="Control.Arrow.html#ArrowPlus"><span class="hs-identifier hs-var">ArrowPlus</span></a></span></span><span> </span><span id="local-6989586621679561766"><span class="annot"><a href="#local-6989586621679561766"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-235"></span><span>    </span><span class="hs-comment">-- | An associative operation with identity 'zeroArrow'.</span><span>
</span><span id="line-236"></span><span>    </span><span id="local-6989586621679561763"><span id="local-6989586621679561764"><span id="%3C%2B%3E"><span class="annot"><a href="Control.Arrow.html#%3C%2B%3E"><span class="hs-operator hs-type">(&lt;+&gt;)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561766"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561764"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561763"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561766"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561764"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561763"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561766"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561764"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561763"><span class="hs-identifier hs-type">c</span></a></span></span></span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-239"></span><span id="local-6989586621679561762"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561762"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowPlus"><span class="hs-identifier hs-type">ArrowPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561762"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-240"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561308"><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561308"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561307"><span class="annot"><span class="annottext">&lt;+&gt; :: forall b c. Kleisli m b c -&gt; Kleisli m b c -&gt; Kleisli m b c
</span><a href="#local-6989586621679561307"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;+&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561306"><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561306"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; m c) -&gt; Kleisli m b c
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679561305"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561305"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561308"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561305"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m c -&gt; m c -&gt; m c
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="GHC.Base.html#mplus"><span class="hs-operator hs-var">`mplus`</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561306"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561305"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">-- | Choice, for arrows that support it.  This class underlies the</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- @if@ and @case@ constructs in arrow notation.</span><span>
</span><span id="line-244"></span><span class="hs-comment">--</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- Instances should satisfy the following laws:</span><span>
</span><span id="line-246"></span><span class="hs-comment">--</span><span>
</span><span id="line-247"></span><span class="hs-comment">--  * @'left' ('arr' f) = 'arr' ('left' f)@</span><span>
</span><span id="line-248"></span><span class="hs-comment">--</span><span>
</span><span id="line-249"></span><span class="hs-comment">--  * @'left' (f &gt;&gt;&gt; g) = 'left' f &gt;&gt;&gt; 'left' g@</span><span>
</span><span id="line-250"></span><span class="hs-comment">--</span><span>
</span><span id="line-251"></span><span class="hs-comment">--  * @f &gt;&gt;&gt; 'arr' 'Left' = 'arr' 'Left' &gt;&gt;&gt; 'left' f@</span><span>
</span><span id="line-252"></span><span class="hs-comment">--</span><span>
</span><span id="line-253"></span><span class="hs-comment">--  * @'left' f &gt;&gt;&gt; 'arr' ('id' +++ g) = 'arr' ('id' +++ g) &gt;&gt;&gt; 'left' f@</span><span>
</span><span id="line-254"></span><span class="hs-comment">--</span><span>
</span><span id="line-255"></span><span class="hs-comment">--  * @'left' ('left' f) &gt;&gt;&gt; 'arr' assocsum = 'arr' assocsum &gt;&gt;&gt; 'left' f@</span><span>
</span><span id="line-256"></span><span class="hs-comment">--</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- where</span><span>
</span><span id="line-258"></span><span class="hs-comment">--</span><span>
</span><span id="line-259"></span><span class="hs-comment">-- &gt; assocsum (Left (Left x)) = Left x</span><span>
</span><span id="line-260"></span><span class="hs-comment">-- &gt; assocsum (Left (Right y)) = Right (Left y)</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- &gt; assocsum (Right z) = Right (Right z)</span><span>
</span><span id="line-262"></span><span class="hs-comment">--</span><span>
</span><span id="line-263"></span><span class="hs-comment">-- The other combinators have sensible default definitions, which may</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- be overridden for efficiency.</span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="ArrowChoice"><span class="annot"><a href="Control.Arrow.html#ArrowChoice"><span class="hs-identifier hs-var">ArrowChoice</span></a></span></span><span> </span><span id="local-6989586621679561759"><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-267"></span><span>    </span><span class="hs-pragma">{-# MINIMAL</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-pragma hs-type">left</span></a></span><span> </span><span class="hs-pragma">|</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">+++</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span>    </span><span class="hs-comment">-- | Feed marked inputs through the argument arrow, passing the</span><span>
</span><span id="line-270"></span><span>    </span><span class="hs-comment">--   rest through unchanged to the output.</span><span>
</span><span id="line-271"></span><span>    </span><span id="local-6989586621679561755"><span id="local-6989586621679561756"><span id="local-6989586621679561757"><span id="left"><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-identifier hs-type">left</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561757"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561756"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561757"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561755"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561756"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561755"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-272"></span><span>    </span><span id="local-6989586621679561301"><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-identifier hs-var hs-var">left</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a b c -&gt; a d d -&gt; a (Either b d) (Either c d)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a d d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>    </span><span class="hs-comment">-- | A mirror image of 'left'.</span><span>
</span><span id="line-275"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-276"></span><span>    </span><span class="hs-comment">--   The default definition may be overridden with a more efficient</span><span>
</span><span id="line-277"></span><span>    </span><span class="hs-comment">--   version if desired.</span><span>
</span><span id="line-278"></span><span>    </span><span id="local-6989586621679561745"><span id="local-6989586621679561746"><span id="local-6989586621679561747"><span id="right"><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-identifier hs-type">right</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561747"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561746"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561745"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561747"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561745"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561746"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-279"></span><span>    </span><span id="local-6989586621679561295"><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-identifier hs-var hs-var">right</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a d d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">a d d -&gt; a b c -&gt; a (Either d b) (Either d c)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span>    </span><span class="hs-comment">-- | Split the input between the two argument arrows, retagging</span><span>
</span><span id="line-282"></span><span>    </span><span class="hs-comment">--   and merging their outputs.</span><span>
</span><span id="line-283"></span><span>    </span><span class="hs-comment">--   Note that this is in general not a functor.</span><span>
</span><span id="line-284"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-285"></span><span>    </span><span class="hs-comment">--   The default definition may be overridden with a more efficient</span><span>
</span><span id="line-286"></span><span>    </span><span class="hs-comment">--   version if desired.</span><span>
</span><span id="line-287"></span><span>    </span><span id="local-6989586621679561748"><span id="local-6989586621679561749"><span id="local-6989586621679561750"><span id="local-6989586621679561751"><span id="%2B%2B%2B"><span class="annot"><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-type">(+++)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561751"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561750"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561749"><span class="hs-identifier hs-type">b'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561748"><span class="hs-identifier hs-type">c'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561751"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561749"><span class="hs-identifier hs-type">b'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561750"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561748"><span class="hs-identifier hs-type">c'</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-288"></span><span>    </span><span id="local-6989586621679561290"><span id="local-6989586621679561280"><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561280"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var hs-var">+++</span></a></span><span> </span><span id="local-6989586621679561279"><span class="annot"><span class="annottext">a b' c'
</span><a href="#local-6989586621679561279"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a b c -&gt; a (Either b b') (Either c b')
forall (a :: * -&gt; * -&gt; *) b c d.
ArrowChoice a =&gt;
a b c -&gt; a (Either b d) (Either c d)
</span><a href="Control.Arrow.html#left"><span class="hs-identifier hs-var">left</span></a></span><span> </span><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561280"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a (Either b b') (Either c b')
-&gt; a (Either c b') (Either c c') -&gt; a (Either b b') (Either c c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(Either c b' -&gt; Either b' c) -&gt; a (Either c b') (Either b' c)
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Either c b' -&gt; Either b' c
forall x y. Either x y -&gt; Either y x
</span><a href="#local-6989586621679561278"><span class="hs-identifier hs-var">mirror</span></a></span><span> </span><span class="annot"><span class="annottext">a (Either c b') (Either b' c)
-&gt; a (Either b' c) (Either c c') -&gt; a (Either c b') (Either c c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a b' c' -&gt; a (Either b' c) (Either c' c)
forall (a :: * -&gt; * -&gt; *) b c d.
ArrowChoice a =&gt;
a b c -&gt; a (Either b d) (Either c d)
</span><a href="Control.Arrow.html#left"><span class="hs-identifier hs-var">left</span></a></span><span> </span><span class="annot"><span class="annottext">a b' c'
</span><a href="#local-6989586621679561279"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a (Either b' c) (Either c' c)
-&gt; a (Either c' c) (Either c c') -&gt; a (Either b' c) (Either c c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(Either c' c -&gt; Either c c') -&gt; a (Either c' c) (Either c c')
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Either c' c -&gt; Either c c'
forall x y. Either x y -&gt; Either y x
</span><a href="#local-6989586621679561278"><span class="hs-identifier hs-var">mirror</span></a></span><span>
</span><span id="line-289"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-290"></span><span>        </span><span id="local-6989586621679561736"><span id="local-6989586621679561737"><span class="annot"><a href="#local-6989586621679561278"><span class="hs-identifier hs-type">mirror</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561737"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561736"><span class="hs-identifier hs-type">y</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561736"><span class="hs-identifier hs-type">y</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561737"><span class="hs-identifier hs-type">x</span></a></span></span></span><span>
</span><span id="line-291"></span><span>        </span><span id="local-6989586621679561278"><span class="annot"><span class="annottext">mirror :: forall x y. Either x y -&gt; Either y x
</span><a href="#local-6989586621679561278"><span class="hs-identifier hs-var hs-var">mirror</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679561277"><span class="annot"><span class="annottext">x
</span><a href="#local-6989586621679561277"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">x -&gt; Either y x
forall a b. b -&gt; Either a b
</span><a href="Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">x
</span><a href="#local-6989586621679561277"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-292"></span><span>        </span><span class="annot"><a href="#local-6989586621679561278"><span class="hs-identifier hs-var">mirror</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679561276"><span class="annot"><span class="annottext">y
</span><a href="#local-6989586621679561276"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">y -&gt; Either y x
forall a b. a -&gt; Either a b
</span><a href="Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">y
</span><a href="#local-6989586621679561276"><span class="hs-identifier hs-var">y</span></a></span></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span>    </span><span class="hs-comment">-- | Fanin: Split the input between the two argument arrows and</span><span>
</span><span id="line-295"></span><span>    </span><span class="hs-comment">--   merge their outputs.</span><span>
</span><span id="line-296"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-297"></span><span>    </span><span class="hs-comment">--   The default definition may be overridden with a more efficient</span><span>
</span><span id="line-298"></span><span>    </span><span class="hs-comment">--   version if desired.</span><span>
</span><span id="line-299"></span><span>    </span><span id="local-6989586621679561729"><span id="local-6989586621679561730"><span id="local-6989586621679561731"><span id="%7C%7C%7C"><span class="annot"><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-type">(|||)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561731"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561730"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561729"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561730"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561731"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561729"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679561730"><span class="hs-identifier hs-type">d</span></a></span></span></span></span><span>
</span><span id="line-300"></span><span>    </span><span id="local-6989586621679561275"><span id="local-6989586621679561269"><span class="annot"><span class="annottext">a b d
</span><a href="#local-6989586621679561269"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-var hs-var">|||</span></a></span><span> </span><span id="local-6989586621679561268"><span class="annot"><span class="annottext">a c d
</span><a href="#local-6989586621679561268"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a b d
</span><a href="#local-6989586621679561269"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a b d -&gt; a c d -&gt; a (Either b c) (Either d d)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a c d
</span><a href="#local-6989586621679561268"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a (Either b c) (Either d d) -&gt; a (Either d d) d -&gt; a (Either b c) d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(Either d d -&gt; d) -&gt; a (Either d d) d
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Either d d -&gt; d
forall {a}. Either a a -&gt; a
</span><a href="#local-6989586621679561267"><span class="hs-identifier hs-var">untag</span></a></span><span>
</span><span id="line-301"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-302"></span><span>        </span><span id="local-6989586621679561267"><span class="annot"><span class="annottext">untag :: Either a a -&gt; a
</span><a href="#local-6989586621679561267"><span class="hs-identifier hs-var hs-var">untag</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679561266"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561266"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561266"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-303"></span><span>        </span><span class="annot"><a href="#local-6989586621679561267"><span class="hs-identifier hs-var">untag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679561265"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561265"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561265"><span class="hs-identifier hs-var">y</span></a></span></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-306"></span><span class="annot"><span class="hs-pragma">&quot;left/arr&quot;</span></span><span>      </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561264"><span class="annot"><a href="#local-6989586621679561264"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-307"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-pragma hs-type">left</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561264"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-pragma hs-type">left</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561264"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-308"></span><span class="annot"><span class="hs-pragma">&quot;right/arr&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561263"><span class="annot"><a href="#local-6989586621679561263"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-309"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-pragma hs-type">right</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561263"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-pragma hs-type">right</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561263"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-310"></span><span class="annot"><span class="hs-pragma">&quot;sum/arr&quot;</span></span><span>       </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561262"><span class="annot"><a href="#local-6989586621679561262"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561261"><span class="annot"><a href="#local-6989586621679561261"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-311"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561262"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-pragma hs-type">+++</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561261"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561262"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-pragma hs-type">+++</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561261"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-312"></span><span class="annot"><span class="hs-pragma">&quot;fanin/arr&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561260"><span class="annot"><a href="#local-6989586621679561260"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561259"><span class="annot"><a href="#local-6989586621679561259"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-313"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561260"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-pragma hs-type">|||</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561259"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#arr"><span class="hs-pragma hs-type">arr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561260"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-pragma hs-type">|||</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561259"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-314"></span><span class="annot"><span class="hs-pragma">&quot;compose/left&quot;</span></span><span>  </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561258"><span class="annot"><a href="#local-6989586621679561258"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561257"><span class="annot"><a href="#local-6989586621679561257"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-315"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-pragma hs-type">left</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561258"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-pragma hs-type">left</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561257"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#left"><span class="hs-pragma hs-type">left</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561258"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561257"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-316"></span><span class="annot"><span class="hs-pragma">&quot;compose/right&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679561256"><span class="annot"><a href="#local-6989586621679561256"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561255"><span class="annot"><a href="#local-6989586621679561255"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-317"></span><span>                </span><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-pragma hs-type">right</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561256"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-pragma hs-type">right</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561255"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Control.Arrow.html#right"><span class="hs-pragma hs-type">right</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679561256"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="Control.Category.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561255"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-318"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-321"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowChoice"><span class="hs-identifier hs-type">ArrowChoice</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-322"></span><span>    </span><span id="local-6989586621679561244"><span class="annot"><span class="annottext">left :: forall b c d. (b -&gt; c) -&gt; Either b d -&gt; Either c d
</span><a href="#local-6989586621679561244"><span class="hs-identifier hs-var hs-var hs-var hs-var">left</span></a></span></span><span> </span><span id="local-6989586621679561243"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561243"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561243"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; c) -&gt; (d -&gt; d) -&gt; Either b d -&gt; Either c d
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">d -&gt; d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-323"></span><span>    </span><span id="local-6989586621679561240"><span class="annot"><span class="annottext">right :: forall b c d. (b -&gt; c) -&gt; Either d b -&gt; Either d c
</span><a href="#local-6989586621679561240"><span class="hs-identifier hs-var hs-var hs-var hs-var">right</span></a></span></span><span> </span><span id="local-6989586621679561239"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561239"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">d -&gt; d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">(d -&gt; d) -&gt; (b -&gt; c) -&gt; Either d b -&gt; Either d c
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561239"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-324"></span><span>    </span><span id="local-6989586621679561235"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561235"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561234"><span class="annot"><span class="annottext">+++ :: forall b c b' c'.
(b -&gt; c) -&gt; (b' -&gt; c') -&gt; Either b b' -&gt; Either c c'
</span><a href="#local-6989586621679561234"><span class="hs-operator hs-var hs-var hs-var hs-var">+++</span></a></span></span><span> </span><span id="local-6989586621679561233"><span class="annot"><span class="annottext">b' -&gt; c'
</span><a href="#local-6989586621679561233"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c -&gt; Either c c'
forall a b. a -&gt; Either a b
</span><a href="Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">(c -&gt; Either c c') -&gt; (b -&gt; c) -&gt; b -&gt; Either c c'
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561235"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(b -&gt; Either c c')
-&gt; (b' -&gt; Either c c') -&gt; Either b b' -&gt; Either c c'
forall (a :: * -&gt; * -&gt; *) b d c.
ArrowChoice a =&gt;
a b d -&gt; a c d -&gt; a (Either b c) d
</span><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-var">|||</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c' -&gt; Either c c'
forall a b. b -&gt; Either a b
</span><a href="Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(c' -&gt; Either c c') -&gt; (b' -&gt; c') -&gt; b' -&gt; Either c c'
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b' -&gt; c'
</span><a href="#local-6989586621679561233"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>    </span><span id="local-6989586621679561232"><span class="annot"><span class="annottext">||| :: forall b d c. (b -&gt; d) -&gt; (c -&gt; d) -&gt; Either b c -&gt; d
</span><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-var hs-var hs-var hs-var">(|||)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; d) -&gt; (c -&gt; d) -&gt; Either b c -&gt; d
forall b d c. (b -&gt; d) -&gt; (c -&gt; d) -&gt; Either b c -&gt; d
</span><a href="Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-328"></span><span id="local-6989586621679561710"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561710"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowChoice"><span class="hs-identifier hs-type">ArrowChoice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561710"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-329"></span><span>    </span><span id="local-6989586621679561219"><span class="annot"><span class="annottext">left :: forall b c d. Kleisli m b c -&gt; Kleisli m (Either b d) (Either c d)
</span><a href="#local-6989586621679561219"><span class="hs-identifier hs-var hs-var hs-var hs-var">left</span></a></span></span><span> </span><span id="local-6989586621679561218"><span class="annot"><span class="annottext">Kleisli m b c
</span><a href="#local-6989586621679561218"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kleisli m b c
</span><a href="#local-6989586621679561218"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Kleisli m b c
-&gt; Kleisli m d d -&gt; Kleisli m (Either b d) (Either c d)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">(d -&gt; d) -&gt; Kleisli m d d
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">d -&gt; d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-330"></span><span>    </span><span id="local-6989586621679561214"><span class="annot"><span class="annottext">right :: forall b c d. Kleisli m b c -&gt; Kleisli m (Either d b) (Either d c)
</span><a href="#local-6989586621679561214"><span class="hs-identifier hs-var hs-var hs-var hs-var">right</span></a></span></span><span> </span><span id="local-6989586621679561213"><span class="annot"><span class="annottext">Kleisli m b c
</span><a href="#local-6989586621679561213"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(d -&gt; d) -&gt; Kleisli m d d
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">d -&gt; d
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">Kleisli m d d
-&gt; Kleisli m b c -&gt; Kleisli m (Either d b) (Either d c)
forall (a :: * -&gt; * -&gt; *) b c b' c'.
ArrowChoice a =&gt;
a b c -&gt; a b' c' -&gt; a (Either b b') (Either c c')
</span><a href="Control.Arrow.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">Kleisli m b c
</span><a href="#local-6989586621679561213"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-331"></span><span>    </span><span id="local-6989586621679561207"><span class="annot"><span class="annottext">Kleisli m b c
</span><a href="#local-6989586621679561207"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561206"><span class="annot"><span class="annottext">+++ :: forall b c b' c'.
Kleisli m b c
-&gt; Kleisli m b' c' -&gt; Kleisli m (Either b b') (Either c c')
</span><a href="#local-6989586621679561206"><span class="hs-operator hs-var hs-var hs-var hs-var">+++</span></a></span></span><span> </span><span id="local-6989586621679561205"><span class="annot"><span class="annottext">Kleisli m b' c'
</span><a href="#local-6989586621679561205"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kleisli m b c
</span><a href="#local-6989586621679561207"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Kleisli m b c
-&gt; Kleisli m c (Either c c') -&gt; Kleisli m b (Either c c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(c -&gt; Either c c') -&gt; Kleisli m c (Either c c')
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; Either c c'
forall a b. a -&gt; Either a b
</span><a href="Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kleisli m b (Either c c')
-&gt; Kleisli m b' (Either c c')
-&gt; Kleisli m (Either b b') (Either c c')
forall (a :: * -&gt; * -&gt; *) b d c.
ArrowChoice a =&gt;
a b d -&gt; a c d -&gt; a (Either b c) d
</span><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-var">|||</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kleisli m b' c'
</span><a href="#local-6989586621679561205"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Kleisli m b' c'
-&gt; Kleisli m c' (Either c c') -&gt; Kleisli m b' (Either c c')
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(c' -&gt; Either c c') -&gt; Kleisli m c' (Either c c')
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">c' -&gt; Either c c'
forall a b. b -&gt; Either a b
</span><a href="Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561204"><span class="annot"><span class="annottext">b -&gt; m d
</span><a href="#local-6989586621679561204"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561203"><span class="annot"><span class="annottext">||| :: forall b d c.
Kleisli m b d -&gt; Kleisli m c d -&gt; Kleisli m (Either b c) d
</span><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-var hs-var hs-var hs-var">|||</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561202"><span class="annot"><span class="annottext">c -&gt; m d
</span><a href="#local-6989586621679561202"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Either b c -&gt; m d) -&gt; Kleisli m (Either b c) d
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; m d) -&gt; (c -&gt; m d) -&gt; Either b c -&gt; m d
forall b d c. (b -&gt; d) -&gt; (c -&gt; d) -&gt; Either b c -&gt; d
</span><a href="Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; m d
</span><a href="#local-6989586621679561204"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; m d
</span><a href="#local-6989586621679561202"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">-- | Some arrows allow application of arrow inputs to other inputs.</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- Instances should satisfy the following laws:</span><span>
</span><span id="line-336"></span><span class="hs-comment">--</span><span>
</span><span id="line-337"></span><span class="hs-comment">--  * @'first' ('arr' (\\x -&gt; 'arr' (\\y -&gt; (x,y)))) &gt;&gt;&gt; 'app' = 'id'@</span><span>
</span><span id="line-338"></span><span class="hs-comment">--</span><span>
</span><span id="line-339"></span><span class="hs-comment">--  * @'first' ('arr' (g &gt;&gt;&gt;)) &gt;&gt;&gt; 'app' = 'second' g &gt;&gt;&gt; 'app'@</span><span>
</span><span id="line-340"></span><span class="hs-comment">--</span><span>
</span><span id="line-341"></span><span class="hs-comment">--  * @'first' ('arr' (&gt;&gt;&gt; h)) &gt;&gt;&gt; 'app' = 'app' &gt;&gt;&gt; h@</span><span>
</span><span id="line-342"></span><span class="hs-comment">--</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- Such arrows are equivalent to monads (see 'ArrowMonad').</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561696"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="ArrowApply"><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier hs-var">ArrowApply</span></a></span></span><span> </span><span id="local-6989586621679561696"><span class="annot"><a href="#local-6989586621679561696"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-346"></span><span>    </span><span id="local-6989586621679561694"><span id="local-6989586621679561695"><span id="app"><span class="annot"><a href="Control.Arrow.html#app"><span class="hs-identifier hs-type">app</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561696"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561696"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561695"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561694"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679561695"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679561694"><span class="hs-identifier hs-type">c</span></a></span></span></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-349"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier hs-type">ArrowApply</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-350"></span><span>    </span><span id="local-6989586621679561196"><span class="annot"><span class="annottext">app :: forall b c. (b -&gt; c, b) -&gt; c
</span><a href="Control.Arrow.html#app"><span class="hs-identifier hs-var hs-var hs-var hs-var">app</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679561195"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561195"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679561194"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561194"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679561195"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561194"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-353"></span><span id="local-6989586621679561690"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561690"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier hs-type">ArrowApply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561690"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-354"></span><span>    </span><span id="local-6989586621679561188"><span class="annot"><span class="annottext">app :: forall b c. Kleisli m (Kleisli m b c, b) c
</span><a href="Control.Arrow.html#app"><span class="hs-identifier hs-var hs-var hs-var hs-var">app</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Kleisli m b c, b) -&gt; m c) -&gt; Kleisli m (Kleisli m b c, b) c
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561187"><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561187"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679561186"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561186"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; m c
</span><a href="#local-6989586621679561187"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561186"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span class="hs-comment">-- | The 'ArrowApply' class is equivalent to 'Monad': any monad gives rise</span><span>
</span><span id="line-357"></span><span class="hs-comment">--   to a 'Kleisli' arrow, and any instance of 'ArrowApply' defines a monad.</span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span class="hs-keyword">newtype</span><span> </span><span id="ArrowMonad"><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span></span><span> </span><span id="local-6989586621679561684"><span class="annot"><a href="#local-6989586621679561684"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679561683"><span class="annot"><a href="#local-6989586621679561683"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ArrowMonad"><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561684"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679561683"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-362"></span><span id="local-6989586621679561687"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561182"><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561687"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561687"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-363"></span><span>    </span><span id="local-6989586621679561179"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; ArrowMonad a a -&gt; ArrowMonad a b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679561178"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679561178"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561177"><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561177"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a () b -&gt; ArrowMonad a b
forall (a :: * -&gt; * -&gt; *) b. a () b -&gt; ArrowMonad a b
</span><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span><span> </span><span class="annot"><span class="annottext">(a () b -&gt; ArrowMonad a b) -&gt; a () b -&gt; ArrowMonad a b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561177"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a () a -&gt; a a b -&gt; a () b
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; a a b
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679561178"><span class="hs-identifier hs-var">f</span></a></span></span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-366"></span><span id="local-6989586621679561682"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561167"><span id="local-6989586621679561169"><span id="local-6989586621679561171"><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561682"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561682"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-367"></span><span>   </span><span id="local-6989586621679561165"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; ArrowMonad a a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679561164"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561164"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a () a -&gt; ArrowMonad a a
forall (a :: * -&gt; * -&gt; *) b. a () b -&gt; ArrowMonad a b
</span><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(() -&gt; a) -&gt; a () a
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; () -&gt; a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561164"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span>   </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561159"><span class="annot"><span class="annottext">a () (a -&gt; b)
</span><a href="#local-6989586621679561159"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561158"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b.
ArrowMonad a (a -&gt; b) -&gt; ArrowMonad a a -&gt; ArrowMonad a b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561157"><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561157"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a () b -&gt; ArrowMonad a b
forall (a :: * -&gt; * -&gt; *) b. a () b -&gt; ArrowMonad a b
</span><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a () (a -&gt; b)
</span><a href="#local-6989586621679561159"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a () (a -&gt; b) -&gt; a () a -&gt; a () (a -&gt; b, a)
forall (a :: * -&gt; * -&gt; *) b c c'.
Arrow a =&gt;
a b c -&gt; a b c' -&gt; a b (c, c')
</span><a href="Control.Arrow.html#%26%26%26"><span class="hs-operator hs-var">&amp;&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561157"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a () (a -&gt; b, a) -&gt; a (a -&gt; b, a) b -&gt; a () b
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; b, a) -&gt; b) -&gt; a (a -&gt; b, a) b
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((a -&gt; b) -&gt; a -&gt; b) -&gt; (a -&gt; b, a) -&gt; b
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; a -&gt; b
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k). Category cat =&gt; cat a a
</span><a href="Control.Category.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-371"></span><span id="local-6989586621679561675"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561150"><span id="local-6989586621679561152"><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier hs-type">ArrowApply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561675"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561675"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-372"></span><span>    </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561145"><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561145"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679561144"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b.
ArrowMonad a a -&gt; (a -&gt; ArrowMonad a b) -&gt; ArrowMonad a b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679561143"><span class="annot"><span class="annottext">a -&gt; ArrowMonad a b
</span><a href="#local-6989586621679561143"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a () b -&gt; ArrowMonad a b
forall (a :: * -&gt; * -&gt; *) b. a () b -&gt; ArrowMonad a b
</span><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span><span> </span><span class="annot"><span class="annottext">(a () b -&gt; ArrowMonad a b) -&gt; a () b -&gt; ArrowMonad a b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-373"></span><span>        </span><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561145"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a () a -&gt; a a b -&gt; a () b
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; (a () b, ())) -&gt; a a (a () b, ())
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679561142"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561142"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561141"><span class="annot"><span class="annottext">a () b
</span><a href="#local-6989586621679561141"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ArrowMonad a b
</span><a href="#local-6989586621679561143"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679561142"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a () b
</span><a href="#local-6989586621679561141"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a a (a () b, ()) -&gt; a (a () b, ()) b -&gt; a a b
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a (a () b, ()) b
forall (a :: * -&gt; * -&gt; *) b c. ArrowApply a =&gt; a (a b c, b) c
</span><a href="Control.Arrow.html#app"><span class="hs-identifier hs-var">app</span></a></span></span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-376"></span><span id="local-6989586621679561672"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561133"><span id="local-6989586621679561135"><span class="annot"><a href="Control.Arrow.html#ArrowPlus"><span class="hs-identifier hs-type">ArrowPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561672"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561672"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-377"></span><span>   </span><span id="local-6989586621679561131"><span class="annot"><span class="annottext">empty :: forall a. ArrowMonad a a
</span><a href="#local-6989586621679561131"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a () a -&gt; ArrowMonad a a
forall (a :: * -&gt; * -&gt; *) b. a () b -&gt; ArrowMonad a b
</span><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span><span> </span><span class="annot"><span class="annottext">a () a
forall (a :: * -&gt; * -&gt; *) b c. ArrowZero a =&gt; a b c
</span><a href="Control.Arrow.html#zeroArrow"><span class="hs-identifier hs-var">zeroArrow</span></a></span><span>
</span><span id="line-378"></span><span>   </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561129"><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561129"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679561128"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. ArrowMonad a a -&gt; ArrowMonad a a -&gt; ArrowMonad a a
</span><a href="#local-6989586621679561128"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span id="local-6989586621679561127"><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561127"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a () a -&gt; ArrowMonad a a
forall (a :: * -&gt; * -&gt; *) b. a () b -&gt; ArrowMonad a b
</span><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-var">ArrowMonad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561129"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a () a -&gt; a () a -&gt; a () a
forall (a :: * -&gt; * -&gt; *) b c.
ArrowPlus a =&gt;
a b c -&gt; a b c -&gt; a b c
</span><a href="Control.Arrow.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a () a
</span><a href="#local-6989586621679561127"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-379"></span><span>
</span><span id="line-380"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-381"></span><span id="local-6989586621679561669"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561119"><span id="local-6989586621679561121"><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier hs-type">ArrowApply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561669"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowPlus"><span class="hs-identifier hs-type">ArrowPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561669"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#ArrowMonad"><span class="hs-identifier hs-type">ArrowMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561669"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-comment">-- | Any instance of 'ArrowApply' can be made into an instance of</span><span>
</span><span id="line-384"></span><span class="hs-comment">--   'ArrowChoice' by defining 'left' = 'leftApp'.</span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span id="local-6989586621679561665"><span id="local-6989586621679561666"><span id="local-6989586621679561667"><span id="local-6989586621679561668"><span class="annot"><a href="Control.Arrow.html#leftApp"><span class="hs-identifier hs-type">leftApp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowApply"><span class="hs-identifier hs-type">ArrowApply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561668"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561668"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561667"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561666"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561668"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561667"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561665"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561666"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561665"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-387"></span><span id="leftApp"><span class="annot"><span class="annottext">leftApp :: forall (a :: * -&gt; * -&gt; *) b c d.
ArrowApply a =&gt;
a b c -&gt; a (Either b d) (Either c d)
</span><a href="Control.Arrow.html#leftApp"><span class="hs-identifier hs-var hs-var">leftApp</span></a></span></span><span> </span><span id="local-6989586621679561104"><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561104"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Either b d -&gt; (a () (Either c d), ()))
-&gt; a (Either b d) (a () (Either c d), ())
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679561103"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561103"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(() -&gt; b) -&gt; a () b
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561103"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a () b -&gt; a b (Either c d) -&gt; a () (Either c d)
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a b c
</span><a href="#local-6989586621679561104"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a b c -&gt; a c (Either c d) -&gt; a b (Either c d)
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(c -&gt; Either c d) -&gt; a c (Either c d)
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; Either c d
forall a b. a -&gt; Either a b
</span><a href="Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(b -&gt; (a () (Either c d), ()))
-&gt; (d -&gt; (a () (Either c d), ()))
-&gt; Either b d
-&gt; (a () (Either c d), ())
forall (a :: * -&gt; * -&gt; *) b d c.
ArrowChoice a =&gt;
a b d -&gt; a c d -&gt; a (Either b c) d
</span><a href="Control.Arrow.html#%7C%7C%7C"><span class="hs-operator hs-var">|||</span></a></span><span>
</span><span id="line-388"></span><span>             </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679561102"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561102"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(() -&gt; d) -&gt; a () d
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561102"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a () d -&gt; a d (Either c d) -&gt; a () (Either c d)
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(d -&gt; Either c d) -&gt; a d (Either c d)
forall (a :: * -&gt; * -&gt; *) b c. Arrow a =&gt; (b -&gt; c) -&gt; a b c
</span><a href="Control.Arrow.html#arr"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">d -&gt; Either c d
forall a b. b -&gt; Either a b
</span><a href="Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a (Either b d) (a () (Either c d), ())
-&gt; a (a () (Either c d), ()) (Either c d)
-&gt; a (Either b d) (Either c d)
forall {k} (cat :: k -&gt; k -&gt; *) (a :: k) (b :: k) (c :: k).
Category cat =&gt;
cat a b -&gt; cat b c -&gt; cat a c
</span><a href="Control.Category.html#%3E%3E%3E"><span class="hs-operator hs-var">&gt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a (a () (Either c d), ()) (Either c d)
forall (a :: * -&gt; * -&gt; *) b c. ArrowApply a =&gt; a (a b c, b) c
</span><a href="Control.Arrow.html#app"><span class="hs-identifier hs-var">app</span></a></span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="hs-comment">-- | The 'loop' operator expresses computations in which an output value</span><span>
</span><span id="line-391"></span><span class="hs-comment">-- is fed back as input, although the computation occurs only once.</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- It underlies the @rec@ value recursion construct in arrow notation.</span><span>
</span><span id="line-393"></span><span class="hs-comment">-- 'loop' should satisfy the following laws:</span><span>
</span><span id="line-394"></span><span class="hs-comment">--</span><span>
</span><span id="line-395"></span><span class="hs-comment">-- [/extension/]</span><span>
</span><span id="line-396"></span><span class="hs-comment">--      @'loop' ('arr' f) = 'arr' (\\ b -&gt; 'fst' ('fix' (\\ (c,d) -&gt; f (b,d))))@</span><span>
</span><span id="line-397"></span><span class="hs-comment">--</span><span>
</span><span id="line-398"></span><span class="hs-comment">-- [/left tightening/]</span><span>
</span><span id="line-399"></span><span class="hs-comment">--      @'loop' ('first' h &gt;&gt;&gt; f) = h &gt;&gt;&gt; 'loop' f@</span><span>
</span><span id="line-400"></span><span class="hs-comment">--</span><span>
</span><span id="line-401"></span><span class="hs-comment">-- [/right tightening/]</span><span>
</span><span id="line-402"></span><span class="hs-comment">--      @'loop' (f &gt;&gt;&gt; 'first' h) = 'loop' f &gt;&gt;&gt; h@</span><span>
</span><span id="line-403"></span><span class="hs-comment">--</span><span>
</span><span id="line-404"></span><span class="hs-comment">-- [/sliding/]</span><span>
</span><span id="line-405"></span><span class="hs-comment">--      @'loop' (f &gt;&gt;&gt; 'arr' ('id' *** k)) = 'loop' ('arr' ('id' *** k) &gt;&gt;&gt; f)@</span><span>
</span><span id="line-406"></span><span class="hs-comment">--</span><span>
</span><span id="line-407"></span><span class="hs-comment">-- [/vanishing/]</span><span>
</span><span id="line-408"></span><span class="hs-comment">--      @'loop' ('loop' f) = 'loop' ('arr' unassoc &gt;&gt;&gt; f &gt;&gt;&gt; 'arr' assoc)@</span><span>
</span><span id="line-409"></span><span class="hs-comment">--</span><span>
</span><span id="line-410"></span><span class="hs-comment">-- [/superposing/]</span><span>
</span><span id="line-411"></span><span class="hs-comment">--      @'second' ('loop' f) = 'loop' ('arr' assoc &gt;&gt;&gt; 'second' f &gt;&gt;&gt; 'arr' unassoc)@</span><span>
</span><span id="line-412"></span><span class="hs-comment">--</span><span>
</span><span id="line-413"></span><span class="hs-comment">-- where</span><span>
</span><span id="line-414"></span><span class="hs-comment">--</span><span>
</span><span id="line-415"></span><span class="hs-comment">-- &gt; assoc ((a,b),c) = (a,(b,c))</span><span>
</span><span id="line-416"></span><span class="hs-comment">-- &gt; unassoc (a,(b,c)) = ((a,b),c)</span><span>
</span><span id="line-417"></span><span class="hs-comment">--</span><span>
</span><span id="line-418"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Arrow.html#Arrow"><span class="hs-identifier hs-type">Arrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561660"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="ArrowLoop"><span class="annot"><a href="Control.Arrow.html#ArrowLoop"><span class="hs-identifier hs-var">ArrowLoop</span></a></span></span><span> </span><span id="local-6989586621679561660"><span class="annot"><a href="#local-6989586621679561660"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-419"></span><span>    </span><span id="local-6989586621679561656"><span id="local-6989586621679561657"><span id="local-6989586621679561658"><span id="loop"><span class="annot"><a href="Control.Arrow.html#loop"><span class="hs-identifier hs-type">loop</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679561660"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561658"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561657"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679561656"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679561657"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679561660"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561658"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561656"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-422"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowLoop"><span class="hs-identifier hs-type">ArrowLoop</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-423"></span><span>    </span><span id="local-6989586621679561095"><span class="annot"><span class="annottext">loop :: forall b d c. ((b, d) -&gt; (c, d)) -&gt; b -&gt; c
</span><a href="Control.Arrow.html#loop"><span class="hs-identifier hs-var hs-var hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679561094"><span class="annot"><span class="annottext">(b, d) -&gt; (c, d)
</span><a href="#local-6989586621679561094"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679561093"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561093"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679561092"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679561092"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679561091"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561091"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b, d) -&gt; (c, d)
</span><a href="#local-6989586621679561094"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561093"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679561091"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679561092"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-424"></span><span>
</span><span id="line-425"></span><span class="hs-comment">-- | Beware that for many monads (those for which the '&gt;&gt;=' operation</span><span>
</span><span id="line-426"></span><span class="hs-comment">-- is strict) this instance will /not/ satisfy the right-tightening law</span><span>
</span><span id="line-427"></span><span class="hs-comment">-- required by the 'ArrowLoop' class.</span><span>
</span><span id="line-428"></span><span class="hs-comment">--</span><span>
</span><span id="line-429"></span><span class="hs-comment">-- @since 2.01</span><span>
</span><span id="line-430"></span><span id="local-6989586621679561650"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Fix.html#MonadFix"><span class="hs-identifier hs-type">MonadFix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561650"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Arrow.html#ArrowLoop"><span class="hs-identifier hs-type">ArrowLoop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679561650"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-431"></span><span>    </span><span id="local-6989586621679561079"><span class="annot"><span class="annottext">loop :: forall b d c. Kleisli m (b, d) (c, d) -&gt; Kleisli m b c
</span><a href="Control.Arrow.html#loop"><span class="hs-identifier hs-var hs-var hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-type">Kleisli</span></a></span><span> </span><span id="local-6989586621679561078"><span class="annot"><span class="annottext">(b, d) -&gt; m (c, d)
</span><a href="#local-6989586621679561078"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; m c) -&gt; Kleisli m b c
forall (m :: * -&gt; *) a b. (a -&gt; m b) -&gt; Kleisli m a b
</span><a href="Control.Arrow.html#Kleisli"><span class="hs-identifier hs-var">Kleisli</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((c, d) -&gt; c) -&gt; m (c, d) -&gt; m c
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">(c, d) -&gt; c
forall a b. (a, b) -&gt; a
</span><a href="Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">(m (c, d) -&gt; m c) -&gt; (b -&gt; m (c, d)) -&gt; b -&gt; m c
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((c, d) -&gt; m (c, d)) -&gt; m (c, d)
forall (m :: * -&gt; *) a. MonadFix m =&gt; (a -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Fix.html#mfix"><span class="hs-identifier hs-var">mfix</span></a></span><span> </span><span class="annot"><span class="annottext">(((c, d) -&gt; m (c, d)) -&gt; m (c, d))
-&gt; (b -&gt; (c, d) -&gt; m (c, d)) -&gt; b -&gt; m (c, d)
forall {k} (cat :: k -&gt; k -&gt; *) (b :: k) (c :: k) (a :: k).
Category cat =&gt;
cat b c -&gt; cat a b -&gt; cat a c
</span><a href="Control.Category.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; (c, d) -&gt; m (c, d)
forall {a}. b -&gt; (a, d) -&gt; m (c, d)
</span><a href="#local-6989586621679561076"><span class="hs-identifier hs-var">f'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679561076"><span class="annot"><span class="annottext">f' :: b -&gt; (a, d) -&gt; m (c, d)
</span><a href="#local-6989586621679561076"><span class="hs-identifier hs-var hs-var">f'</span></a></span></span><span> </span><span id="local-6989586621679561075"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561075"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679561074"><span class="annot"><span class="annottext">(a, d)
</span><a href="#local-6989586621679561074"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b, d) -&gt; m (c, d)
</span><a href="#local-6989586621679561078"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679561075"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(a, d) -&gt; d
forall a b. (a, b) -&gt; b
</span><a href="Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(a, d)
</span><a href="#local-6989586621679561074"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-433"></span></pre></body></html>